package l1j.server.server.command.executor;

import l1j.opqlo.Server.L1World.L1World;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.serverpackets.S_SystemMessage;

public class L1ReStore  implements L1CommandExecutor{

	public static L1ReStore getInstance(){
		return new L1ReStore();
	}


	@Override
	public void execute(L1PcInstance pc, String cmdName, String arg) {

		final L1PcInstance target = L1World.getInstance().getPlayer(arg);
		if (target != null) {
			target.getDwarfInventory().loadItems();
			target.getDwarfForElfInventory().loadItems();
			if(pc!=null){
				pc.sendPackets(new S_SystemMessage("該角色倉庫資料已重新加載。"));
			}else{
				System.out.println("該角色倉庫資料已重新加載。");
			}
		}else{
			if(pc!=null){
				pc.sendPackets(new S_SystemMessage("該角色不在線上。"));
			}else{
				System.out.println("該角色不在線上。");
			}

		}

	}

}
